package com.jjclub.service.impl.system;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jjclub.entity.JjclubRole;
import com.jjclub.entity.JjclubUser;
import com.jjclub.mapper.JjclubUserMapper;
import com.jjclub.service.system.UserService;
import com.jjclub.vo.ResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Classname UserServiceImpl
 * @Description TODO
 * @Date 2019/11/22 15:51
 * @Created by jq
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private JjclubUserMapper jjclubUserMapper;

    @Override
    public ResponseVO userList(Integer nowpage, Integer pagesize) {
        PageHelper.startPage(nowpage, pagesize);
        List<JjclubUser> list = jjclubUserMapper.selectAll();
        PageInfo<JjclubUser> page = new PageInfo<>(list);
        ResponseVO responseVO = new ResponseVO();
        responseVO.setMsg("success");
        responseVO.setCode(0);
        responseVO.setCount(page.getTotal());
        responseVO.setData(page.getList());
        return responseVO;
    }
}
